package demo;

import java.time.LocalDateTime;

import com.aerospike.client.IAerospikeClient;
import com.aerospike.client.policy.WritePolicy;

public class DurableDeleteTest {

	public static void main(String[] args) throws Exception {

		IAerospikeClient client = AsClientUtil.getClient();
		System.out.println("client=" + client);

		String namespace = "ns1";
		String dataSetName = "testset";
		String bin = "DATA";
		WritePolicy policy = new WritePolicy();
		policy.durableDelete = true;

		System.out.println("namespace=" + namespace);
		System.out.println("dataSetName=" + dataSetName);
		System.out.println("bin=" + bin);

		String key = "durableDelete_test";
		String value = key + "-" + LocalDateTime.now();
		
		// com.aerospike.client.AerospikeException: Error Code 25
		
		AsClientUtil.put(client, policy, namespace, dataSetName, key, bin, value);

		System.out.println("DurableDeleteTest write done," + LocalDateTime.now());

	}

}
